Skip to content

[codex] Skip plugin MCP OAuth for matching app routes - #27461

Merged
felixxia-oai merged 2 commits into
mainfrom
plugin-auth-routing-tool-exposure
Jun 15, 2026
Merged

[codex] Skip plugin MCP OAuth for matching app routes#27461
felixxia-oai merged 2 commits into
mainfrom
plugin-auth-routing-tool-exposure

Conversation

@felixxia-oai

@felixxia-oai felixxia-oai commented Jun 10, 2026

Copy link
Copy Markdown
Contributor

Context

This is PR5 in the plugin auth-routing stack. Earlier PRs make plugin surface projection auth-aware, narrow App/MCP conflicts by App declaration name, and keep connector listings auth-aware. This PR applies the same name-based App/MCP conflict rule into plugin MCP loading, so install-time MCP OAuth and plugin detail metadata both reflect the MCPs available for the current auth route.

Stack

Summary

  • Make load_plugin_mcp_servers auth-aware and let it load App declarations before filtering same-name MCP servers for Codex-backend auth.
  • Use that filtered MCP list for both install-time MCP OAuth and marketplace plugin detail metadata.
  • Preserve API-key/direct auth behavior so plugin MCP servers remain visible and can still start OAuth.

Validation

cargo fmt --all
cargo test -p codex-core-plugins read_plugin_for_config_filters_mcp_servers_for_codex_backend_auth
cargo check -p codex-core-plugins -p codex-app-server
git diff --check
git diff --cached --check

@felixxia-oai
felixxia-oai force-pushed the plugin-auth-routing-tool-exposure branch from d0dcd56 to c842865 Compare June 10, 2026 21:56
@felixxia-oai
felixxia-oai changed the base branch from plugin-auth-routing-guidance to plugin-auth-routing-route-model June 10, 2026 21:56
@felixxia-oai
felixxia-oai marked this pull request as ready for review June 10, 2026 23:03

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 405eb48fb6

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread codex-rs/app-server/src/request_processors/plugins.rs Outdated
Comment thread codex-rs/app-server/src/request_processors/plugins.rs Outdated
Comment thread codex-rs/app-server/src/request_processors/plugins.rs Outdated
@felixxia-oai
felixxia-oai force-pushed the plugin-auth-routing-tool-exposure branch from 405eb48 to bb0eea4 Compare June 10, 2026 23:19
@felixxia-oai
felixxia-oai marked this pull request as draft June 11, 2026 10:50
@felixxia-oai
felixxia-oai force-pushed the plugin-auth-routing-route-model branch 2 times, most recently from 879d237 to 74c31a9 Compare June 11, 2026 13:22
@felixxia-oai
felixxia-oai force-pushed the plugin-auth-routing-tool-exposure branch from a0609b0 to 9ccc20e Compare June 11, 2026 13:22
@felixxia-oai
felixxia-oai changed the base branch from plugin-auth-routing-route-model to plugin-auth-aware-connector-listing June 11, 2026 13:22
@felixxia-oai
felixxia-oai force-pushed the plugin-auth-routing-tool-exposure branch from 9ccc20e to e5a0fae Compare June 11, 2026 13:26
@felixxia-oai
felixxia-oai force-pushed the plugin-auth-aware-connector-listing branch from e7efa5f to ff11d44 Compare June 11, 2026 13:42
@felixxia-oai
felixxia-oai force-pushed the plugin-auth-routing-tool-exposure branch from e5a0fae to 31ffc25 Compare June 11, 2026 13:43
@felixxia-oai
felixxia-oai force-pushed the plugin-auth-aware-connector-listing branch from ff11d44 to 57f261e Compare June 11, 2026 13:52
@felixxia-oai
felixxia-oai force-pushed the plugin-auth-routing-tool-exposure branch from 31ffc25 to 77fc783 Compare June 11, 2026 13:53
@felixxia-oai
felixxia-oai force-pushed the plugin-auth-aware-connector-listing branch from 57f261e to 367abd8 Compare June 11, 2026 13:55
@felixxia-oai
felixxia-oai force-pushed the plugin-auth-routing-tool-exposure branch from 77fc783 to 862e4b0 Compare June 11, 2026 13:56
@felixxia-oai
felixxia-oai force-pushed the plugin-auth-aware-connector-listing branch from 367abd8 to e3d001e Compare June 11, 2026 14:02
@felixxia-oai
felixxia-oai force-pushed the plugin-auth-routing-tool-exposure branch from 862e4b0 to cd63752 Compare June 11, 2026 14:04
@felixxia-oai
felixxia-oai force-pushed the plugin-auth-aware-connector-listing branch from e3d001e to e78b5d7 Compare June 11, 2026 14:23
@felixxia-oai
felixxia-oai force-pushed the plugin-auth-routing-tool-exposure branch from cd63752 to 4e1e327 Compare June 11, 2026 14:24
@felixxia-oai
felixxia-oai force-pushed the plugin-auth-aware-connector-listing branch from e78b5d7 to 15ddc60 Compare June 11, 2026 15:10
@felixxia-oai
felixxia-oai force-pushed the plugin-auth-routing-tool-exposure branch from 4e1e327 to 56b33ba Compare June 11, 2026 15:16
@felixxia-oai felixxia-oai changed the title [codex] Skip plugin MCP OAuth when app route is available [codex] Skip plugin MCP OAuth for matching app routes Jun 11, 2026
@felixxia-oai

Copy link
Copy Markdown
Contributor Author

@codex review

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 56b33ba407

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread codex-rs/app-server/src/request_processors/plugins.rs Outdated
@felixxia-oai
felixxia-oai force-pushed the plugin-auth-routing-tool-exposure branch from bcf93fe to eb86e3d Compare June 11, 2026 20:48
@felixxia-oai
felixxia-oai force-pushed the plugin-auth-aware-connector-listing branch from b633689 to df6421f Compare June 11, 2026 20:54
@felixxia-oai
felixxia-oai force-pushed the plugin-auth-routing-tool-exposure branch from eb86e3d to 0535f2c Compare June 11, 2026 20:55
@felixxia-oai
felixxia-oai force-pushed the plugin-auth-aware-connector-listing branch from df6421f to 559560a Compare June 11, 2026 21:01
@felixxia-oai
felixxia-oai force-pushed the plugin-auth-routing-tool-exposure branch from 0535f2c to fc0f139 Compare June 11, 2026 21:02
@felixxia-oai
felixxia-oai force-pushed the plugin-auth-aware-connector-listing branch from 559560a to b9005c0 Compare June 11, 2026 21:16
@felixxia-oai
felixxia-oai force-pushed the plugin-auth-routing-tool-exposure branch from fc0f139 to a878ff0 Compare June 11, 2026 21:16
@felixxia-oai
felixxia-oai force-pushed the plugin-auth-aware-connector-listing branch from b9005c0 to e1b01e3 Compare June 11, 2026 21:25
@felixxia-oai
felixxia-oai force-pushed the plugin-auth-routing-tool-exposure branch from a878ff0 to a51ec39 Compare June 11, 2026 21:25
@felixxia-oai
felixxia-oai force-pushed the plugin-auth-aware-connector-listing branch from e1b01e3 to b5d3752 Compare June 11, 2026 21:54
@felixxia-oai
felixxia-oai force-pushed the plugin-auth-routing-tool-exposure branch 4 times, most recently from a7c443d to 65c8984 Compare June 11, 2026 22:59
@felixxia-oai

Copy link
Copy Markdown
Contributor Author

@codex review

@felixxia-oai
felixxia-oai marked this pull request as ready for review June 11, 2026 23:13

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 65c8984860

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread codex-rs/core-plugins/src/loader.rs
@felixxia-oai
felixxia-oai force-pushed the plugin-auth-aware-connector-listing branch from b5d3752 to f5b1e24 Compare June 12, 2026 09:45
@felixxia-oai
felixxia-oai requested a review from a team as a June 12, 2026 09:45
@felixxia-oai
felixxia-oai force-pushed the plugin-auth-routing-tool-exposure branch from 65c8984 to dd137a9 Compare June 12, 2026 09:45
@felixxia-oai
felixxia-oai force-pushed the plugin-auth-aware-connector-listing branch from f5b1e24 to 97ce014 Compare June 12, 2026 10:14
@felixxia-oai
felixxia-oai force-pushed the plugin-auth-routing-tool-exposure branch 3 times, most recently from 2ef9f93 to e965da8 Compare June 12, 2026 10:32
xl-openai added a commit that referenced this pull request Jun 13, 2026
## Context

Plugins can expose more than one way for Codex to use them: App
connectors for ChatGPT/SIWC-backed sessions and MCP servers for API key
login sessions. The broader goal is to make `PluginsManager` the place
that understands which plugin surfaces should be visible for the current
auth route, so callers do not each have to make that decision
themselves.

This PR is the small setup step for that work. It lets the plugin
manager be created with the current `AuthMode`, which gives the followup
auth routing PRs the information they need without relying on setter
injection.

## Stack

- PR1: #27652 seed plugin manager auth at construction.
- PR2: #27459 route plugin surfaces by auth mode.
- PR3: #27607 dedupe plugin MCP servers by App declaration name.
- PR4: #27602 preserve plugin Apps in connector listings.
- PR5: #27461 skip install-time plugin MCP OAuth for matching App
routes.

## Summary

- Let `PluginsManager::new_with_restriction_product` accept an initial
`AuthMode`.
- Keep `PluginsManager::new` behavior unchanged for ordinary callers.

## Validation

```bash
cargo test -p codex-core-plugins plugins_manager_tracks_auth_mode
cargo test -p codex-core list_tool_suggest_discoverable_plugins
git diff --check
```

---------

Co-authored-by: Xin Lin <xl@openai.com>
xl-openai pushed a commit that referenced this pull request Jun 13, 2026
## Context

Some plugins expose both Apps and MCP servers. This PR moves auth-aware
surface projection into `core-plugins::PluginsManager`, so callers get a
consistent effective plugin view. Later PRs narrow the conflict rule and
update listing/install paths.

The high level goal of this PR is to set up the plumbing to
conditionally filter App/MCP in the plugin manager layer. We start by
removing MCP servers when using SIWC/Codex-backend auth, and removing
Apps when using API-key-style auth.

This PR is now stacked on #27652, which contains only the constructor
plumbing for seeding `PluginsManager` with the current auth mode.

## Stack

- PR1: #27652 seed plugin manager auth at construction.
- PR2: #27459 route plugin surfaces by auth mode.
- PR3: #27607 dedupe plugin MCP servers by App declaration name.
- PR4: #27602 preserve plugin Apps in connector listings.
- PR5: #27461 skip install-time plugin MCP OAuth for matching App
routes.

## Summary

- API-key/non-ChatGPT routes hide plugin Apps and keep plugin MCPs.
- ChatGPT/SIWC with Apps enabled keeps plugin Apps and suppresses MCPs
for dual-surface plugins.
- MCP-only plugins stay available for ChatGPT/SIWC sessions.
- Cached plugin load outcomes are re-projected when auth mode changes.

## Validation

```bash
cargo test -p codex-core-plugins plugin_auth_projection
cargo test -p codex-core list_tool_suggest_discoverable_plugins
git diff --check
```
xl-openai added a commit that referenced this pull request Jun 14, 2026
## Context

This is the next step in the plugin auth-routing stack. The earlier PRs
make `PluginsManager` auth-aware and move the broad App/MCP surface
decision into that layer. This PR narrows the ChatGPT/SIWC behavior so
we only hide a plugin MCP server when it conflicts with an App
declaration of the same name.

In product terms: if a plugin exposes both an App route and MCP route
for `foo`, ChatGPT/SIWC sessions should use the App route for `foo`. If
the same plugin also exposes a separate MCP server like `foo2`, that MCP
server should remain available.

```json
// .app.json
{
  "apps": {
    "foo": {
      "id": "connector_abc"
    }
  }
}
```

```json
// .mcp.json
{
  "mcpServers": {
    "foo": {
      "url": "https://mcp.foo.com/mcp"
    },
    "foo2": {
      "url": "https://mcp.foo2.com/mcp"
    }
  }
}
```

## Stack

- PR1: #27652 seed plugin manager auth at construction.
- PR2: #27459 route plugin surfaces by auth mode.
- PR3: #27607 dedupe plugin MCP servers by App declaration name.
- PR4: #27602 preserve plugin Apps in connector listings.
- PR5: #27461 skip install-time plugin MCP OAuth for matching App
routes.

## Summary

- Preserve App declaration names in loaded plugin metadata.
- Keep public effective App outputs as deduped connector IDs for
existing callers.
- For ChatGPT/SIWC, suppress only plugin MCP servers whose names match
declared App names.

## Validation

```bash
cargo fmt --all
cargo test -p codex-core-plugins plugin_auth_projection
cargo test -p codex-core-plugins effective_apps
cargo test -p codex-core-plugins read_plugin_for_config_installed_git_source_reads_from_cache_without_cloning
cargo test -p codex-core explicit_plugin_mentions_use_apps_for_chatgpt_dual_surface_plugins
cargo test -p codex-core explicit_plugin_mentions_keep_non_conflicting_mcp_for_chatgpt_auth
cargo test -p codex-app-server --test all plugin_install_filters_disallowed_apps_needing_auth
git diff --check
```

---------

Co-authored-by: Xin Lin <xl@openai.com>
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants